function Bullet(map, left, top) {
	// call the super-constructor
	Character.call(this, map, {
		height: 24,
		width: 21,
		left: left,
		top: top,
		speed: 3,
		isAutoMoving: true,
		canJump: false,
		dieOnCollide: true,
		isJumping: false,
		isBullet: true,
		speedY: 0,
		spriteData: {
			image: _images.object,
			frameWidth: 57,
			frameHeight: 57,
			interval: 100
		}
	});

	this.isRight = true;
	//this.speedY = 0;

	this.addSprite({
		name: "shoot_right",
		startFrame: 12,
		frameCount: 4,
		marginTop: 22,
		marginBottom: 21,
		marginLeft: 7,
		marginRight: 7
	});
	this.addSprite({
		name: "shoot_left",
		startFrame: 16,
		frameCount: 4,
		marginTop: 22,
		marginBottom: 21,
		marginLeft: 7,
		marginRight: 7
	});
    
    this.addSprite({
		name: "die",
		startFrame: 96,
		frameCount: 1,
		marginTop: 5,
		marginBottom: 3,
		marginLeft: 3,
		marginRight: 4
	});
}

Bullet.prototype = new Character();
Bullet.prototype.update = function() {
	//Character.prototype.update.call(this);	
	// update
	if (this.isRight)
		this.left += this.speed;
	else
		this.left -= this.speed;

	this.right = this.left + this.width;

	this.collide(this.map.monsters, this.map.bullets);
	if (this.isOutsideView()) {
		this.die();
	}
}
Bullet.prototype.draw = function(context) {

	AnimatedSprite.prototype.draw.call(this, context, this.map.offsetX, this.map.offsetY);
	if (this.isRight) {
		this.setSprite("shoot_right");
	} else {
		this.setSprite("shoot_left");
	}
}

// check collision with other object
Bullet.prototype.collide = function(monsters, bullets) {

	for (var i = 0; i < monsters.length; i++) {
		var m = monsters[i];

		if (!(this.left > m.right ||
			this.right < m.left ||
			this.top > m.bottom ||
			this.bottom < m.top)) {
			 
            if(m.typeMonster != "king") {
                m.setSprite("die");
    			this.die();
    			m.die();
            } else if(m.typeMonster == "king"){
                if(m.life <= 0) {
                    m.setSprite("die");
        			this.die();
        			m.die();    
                } else {
                    m.life--;
                    m.setSprite("hitted");
                    this.die();
                    return;
                }
            }
			return;
		}

	}
	for (var i = 0; i < bullets.length; i++) {
		var b = bullets[i];
        if(this.collideObj(this, m)) {
        }
		if (!(this.left > m.right ||
			this.right < m.left ||
			this.top > m.bottom ||
			this.bottom < m.top)) {
			 
            this.setSprite("die");
			this.die();
			b.die();
			return;
		}
	}
}